package com.example.hisapp;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.util.AttributeSet;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.Toast;

import androidx.annotation.Nullable;

public class BottomLayout {
    private Context m_context;
    private Button m_btnNav01,m_btnNav02,m_btnNav03,m_btnNav04;
    private Activity m_activity;
    public BottomLayout(Context context) {
        this.m_context = context;
        m_activity = (Activity)m_context;
        m_btnNav01 =m_activity.findViewById(R.id.BTN_NAV01);
        m_btnNav02 =m_activity.findViewById(R.id.BTN_NAV02);
        m_btnNav03 =m_activity.findViewById(R.id.BTN_NAV03);
        m_btnNav04 =m_activity.findViewById(R.id.BTN_NAV04);
        m_btnNav01.setOnClickListener(new View.OnClickListener(){
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(m_context,PlanMainActivity.class);
                m_context.startActivity(intent);
                Toast.makeText(m_context,"nav01",Toast.LENGTH_SHORT).show();
            }
        });
        m_btnNav02.setOnClickListener(new View.OnClickListener(){

            @Override
            public void onClick(View v) {
                Intent intent = new Intent(m_context,BookMainActivity.class);
                m_context.startActivity(intent);
                Log.d("dd","切换到Nav02界面");
                Toast.makeText(m_context,"222",Toast.LENGTH_SHORT).show();
            }
        });
        m_btnNav03.setOnClickListener(new View.OnClickListener(){

            @Override
            public void onClick(View v) {
                Toast.makeText(m_context,"33333",Toast.LENGTH_SHORT).show();
            }
        });
        m_btnNav04.setOnClickListener(new View.OnClickListener(){

            @Override
            public void onClick(View v) {
                Toast.makeText(m_context,"nav04",Toast.LENGTH_SHORT).show();
            }
        });
    }



}
